var mongoose = require("mongoose");
var url = "mongodb://localhost:27017/mydb?authSource=admin"; //本地数据库地址
let Goods = require("./models/GoodsSchema")
mongoose.connect(url, { useNewUrlParser: true, useUnifiedTopology: true }, (err, db) =>{
    let goods = new Goods({
        GoodsId:"123456789",//商品ID
        GoodsName:"恒星",//商品名称
        GoodsPrice:"123456789",//商品价格
        GoodsNumber:"男",//商品数量
        GoodsInformation:"19",//商品信息
        GoodsAddress:"打球",//商品地址
    })
    Goods.create(goods, (err) => {
        if (err)
            console.log("创建失败")
        else
            console.log("创建成功")
            //
    })

})


